package com.design.composite.demo.transparent;

public class Course extends CourseComponet {


    private String name;

    private double price;

    public Course(String name, double price) {
        this.name = name;
        this.price = price;
    }

    @Override
    String getName(CourseComponet courseComponet) {
        return this.name;
    }

    @Override
    double getPrice(CourseComponet courseComponet) {
        return this.price;
    }

    @Override
    void print() {
        System.out.println(name + "(￥" + price + "元)");
    }
}
